<template>
  <van-nav-bar
    title="热点新闻"
    :left-text="leftText"
    right-text="刷新"
    @click-left="toggleShowBookmark"
    @click-right="handlerefresh"
  />
</template>

<script setup>
// defineProps is a compiler macro and no longer needs to be imported
import { computed } from "vue";

const leftText = computed(() => {
  return props.showBookmark ? "返回" : "收藏";
});

const props = defineProps(["toggleShowBookmark", "showBookmark"]);

function handlerefresh() {
  window.location.reload();
}
</script>
